def fact(n):
    i=1
    result=1
    while i<=n:
        result=result*i
    return result

def sum(n):
    num=0
    i=1
    while i<=n:
        num+=fact(i)
    return num

n=int(input())
number=sum(n)
print(number)